import http from "@/request/index"
import Vue from "vue";
export default {
    namespaced: true,
    state: {
        // 文章分类列表
        articleCateList: []
    },
    actions: {
        async getArticleCatList(context) {
            // 获取文章分类列表
            const {
                code,
                msg,
                page
            } = await http.get("/api/label/list", {
                page: 1,
                limit: 20,
            });
            if (code == 200) {
                context.commit('updateArticleCatList', page.list)
            }
            // console.log(page)

        },

    },
    mutations: {
        // 更新文章分类
        updateArticleCatList(state, articleCateList) {
            state.articleCateList = articleCateList
        }
    },

    getters: {}
}